package sv.com.globalsolutionslt.manejador;

import sv.com.globalsolutionslt.entidades.AreaEmpresa;
import java.io.Serializable;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;
import javax.ejb.EJB;
import javax.faces.event.ActionEvent;
import javax.inject.Named;
import javax.faces.view.ViewScoped;
import sv.com.globalsolutionslt.controlador.AreaEmpresaFacade;

@Named(value = "areaEmpresaController")
@ViewScoped
public class AreaEmpresaController extends AbstractController<AreaEmpresa> implements Serializable {

    @EJB
    private AreaEmpresaFacade areaEmpresaFacade;
    private List<AreaEmpresa> lAreaEmpresa=null;
    
    public AreaEmpresaController() {
        super(AreaEmpresa.class);
    }

    public List<AreaEmpresa> getlAreaEmpresa() {
        lAreaEmpresa= areaEmpresaFacade.AreaEmpresaActivo();
        return lAreaEmpresa;
    }
    
    @Override
    public void save(ActionEvent event) {
        this.getSelected().setFechaMod(Calendar.getInstance().getTime());
        this.getSelected().setUsuarioMod(1);
        super.save(event); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void saveNew(ActionEvent event) {
        this.getSelected().setFechaMod(Calendar.getInstance().getTime());
        this.getSelected().setUsuarioMod(1);
        super.saveNew(event); //To change body of generated methods, choose Tools | Templates.
    }   
    
}
